import { isHidden } from "vant/lib/utils";
import { createRouter, createWebHashHistory } from "vue-router";
const defRoutes = [
  {
    path: "/",
    redirect: "/login",
  },
  {
    name: "login",
    path: "/login",
    component: () => import("@/views/login/login.vue"),
  },
];
export const routes = [
  {
    path: "/money",
    name: "Money",
    redirect: "/moneyPay",
    meta: { title: "合同中心", icon: "icon-xianxingtubiaozhizuomoban-47" },
    children: [
      {
        path: "/moneyBook_ok",
        component: () => import("@/views/money/moneyBook_ok.vue"),
        name: "moneyBook_ok",
        meta: { title: "合同记录(已完成)" },
      },
      {
        path: "/moneyBook_wait",
        component: () => import("@/views/money/moneyBook_wait.vue"),
        name: "moneyBook_wait",
        meta: { title: "合同记录(待签约)" },
      },
      {
        path: "/moneyBook_cancel",
        component: () => import("@/views/money/moneyBook_cancel.vue"),
        name: "moneyBook_cancel",
        meta: { title: "合同记录(已取消)" },
      },
      {
        path: "/moneyBookDetail",
        isHidden: true,
        component: () => import("@/views/money/moneyBookDetail.vue"),
        name: "moneyBookDetail",
        meta: { title: "合同记录(已完成)" },
      },
      {
        path: "/moneyPay",
        component: () => import("@/views/money/moneyPay.vue"),
        name: "MoneyPay",
        meta: { title: "支付记录" },
      },
      {
        path: "/moneyBack",
        component: () => import("@/views/money/moneyBack.vue"),
        name: "MoneyBack",
        meta: { title: "退款申请" },
      },
    ],
  },
  {
    path: "/set",
    name: "Set",
    redirect: "/setBanner",
    meta: { title: "设置中心", icon: "icon-shezhi" },
    children: [
      {
        path: "/setBanner",
        isHidden: true,
        component: () => import("@/views/set/setBanner.vue"),
        name: "SetBanner",
        meta: { title: "轮播图设置" },
      },
      {
        path: "/setHelp",
        component: () => import("@/views/set/setHelp.vue"),
        name: "SetHelp",
        meta: { title: "帮助中心" },
      },
      {
        path: "/setHelpAdd",
        isHidden: true,
        component: () => import("@/views/set/setHelpAdd.vue"),
        name: "SetHelpAdd",
        meta: { title: "新增帮助" },
      },
      {
        path: "/setPay",
        component: () => import("@/views/set/setPay.vue"),
        name: "SetPay",
        meta: { title: "手续费设置" },
      },
      {
        path: "/setLink",
        component: () => import("@/views/set/setLink.vue"),
        name: "SetLink",
        meta: { title: "平台协议" },
      },
    ],
  },
];

const router = createRouter({
  history: createWebHashHistory(),
  routes: defRoutes.concat(routes),
});

export default router;
